#include "myTreeItemData.h"

MyTreeItemData::MyTreeItemData(Solid *_s) : s(_s){
    f = NULL;
    e = NULL;
    v = NULL;
    p = NULL;
}

MyTreeItemData::MyTreeItemData(Face *_f) : f(_f){
    s = NULL;
    e = NULL;
    v = NULL;
    p = NULL;
}

MyTreeItemData::MyTreeItemData(Edge *_e) : e(_e){
    s = NULL;
    f = NULL;
    v = NULL;
    p = NULL;
}

MyTreeItemData::MyTreeItemData(Vertex *_v) : v(_v){
    s = NULL;
    f = NULL;
    e = NULL;
    p = NULL;
}

MyTreeItemData::MyTreeItemData(Point *_p) : p(_p){
    s = NULL;
    f = NULL;
    e = NULL;
    v = NULL;
}

MyTreeItemData::~MyTreeItemData(){}

Solid *MyTreeItemData::getSolid(){
    return s;
}

Face *MyTreeItemData::getFace(){
    return f;
}

Edge *MyTreeItemData::getEdge(){
    return e;
}

Vertex *MyTreeItemData::getVertex(){
    return v;
}

Point *MyTreeItemData::getPoint(){
    return p;
}

void MyTreeItemData::select(bool _selection, Scene *_scene){
    if (s != NULL){
        _scene->addSelectedSolid(s, _selection);
        return;
    }
    if (f != NULL){
        _scene->addSelectedFace(f, _selection);
        return;
    }
    if (e != NULL){
        _scene->addSelectedEdge(e, _selection);
        return;
    }
    if (v != NULL){
        _scene->addSelectedVertex(v, _selection);
        return;
    }
    if (p != NULL){
        _scene->addSelectedPoint(p, _selection);
        return;
    }
}
